﻿using System;
using System.Windows.Data;
using FamilyBook.Core.Entities;

namespace FamilyBook.UI.WPF.Converters
{
    public class AccountToShortStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var acct = value as Account;
            if (acct != null)
                return string.Format("{0} / {1} ({2})", acct.Number, acct.DisplayedName, acct.Currency.Code);

            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
